app.controller('BusOrderModalCtrl', function ($scope, $modalInstance, toaster, param) {

	$scope.param = param;

	if ($scope.param.type == "refund") {
		$scope.flag = false;
	} else if ($scope.param.type == "update") {
		$scope.flag = true;
	}

	$scope.ok = function () {
		if ($scope.flag) {
			if ($scope.param.payment) {
				$modalInstance.close(param);
			} else {
				toaster.pop('warning', '提示', '退款方式不可为空');
			}
		} else {
			$modalInstance.close();
		}
	};

	$scope.cancel = function () {
		$modalInstance.dismiss('cancel');
	};
});